package ${entity.namespace}.${prefixPackage};

import java.io.Serializable;
import java.util.Date;

public class ${entity.nameCapital}Id implements Serializable {
	private static final long serialVersionUID = ${statics["com.fzy.core.codetools.Utils"].getRandomLong()};
<#list entity.keyProperties as property><#t/>
	${property.javaType} ${property.nameUncapital};
</#list><#t/>

<#list entity.keyProperties as property><#t/>
	public ${property.javaType} get${property.nameCapital}() {
		return ${property.nameUncapital};
	}
	public void set${property.nameCapital}(${property.javaType} ${property.nameUncapital}) {
		this.${property.nameUncapital} = ${property.nameUncapital};
	}
</#list><#t/>

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ${entity.nameCapital}Id))
			return false;
		${entity.nameCapital}Id o = (${entity.nameCapital}Id) other;

		return (
<#list entity.keyProperties as property><#t/>
					(
						this.get${property.nameCapital}() == o.get${property.nameCapital}()
						|| (
								this.get${property.nameCapital}() != null
								&& o.get${property.nameCapital}() != null 
								&& this.get${property.nameCapital}().equals(o.get${property.nameCapital}())
							)
					)
<#if property_has_next><#t/>
					&&
</#if><#t/>
</#list><#t/>
				);
	}

	public int hashCode() {
		int result = 17;
<#list entity.keyProperties as property><#t/>
		result = 37 * result + (get${property.nameCapital}() == null ? 0 : this.get${property.nameCapital}().hashCode());
	${property.javaType} ${property.nameUncapital};
</#list><#t/>
		return result;
	}
}